<template>
    <div class="full">
        <div  v-for="plan in plans" :key="plan.id" @click="onPlanClick(plan.id)"  class="single_item" :class="{finish:plan.status==1,important:plan.statu!=1&&plan.important,urgent:plan.statu!=1&&!plan.important}">
            {{plan.text}}
            <el-button v-if="plan.status != 1" size="mini" icon="el-icon-circle-check" circle class="float-left" v-on:click.stop="onFinish(plan.id)"></el-button>
            <el-button size="mini" icon="el-icon-delete" circle class="float-right" v-on:click.stop="onDelete(plan.id)"></el-button>
        </div>
    </div>
</template>

<script>
export default {
    name:"plan-list",
    props:['plans'],
    methods:{
        onPlanClick:function(id){
            this.$emit('onPlanClick',id);
        },
        onDelete:function(id){
            this.$emit('onDelete',id);
        },
        onFinish:function(id){
            this.$emit('onFinish',id);
        }
    }
}
</script>

<style>
.full{
    height: 100%;
    width: 100%;
}
.single_item{
    height: 30px;
    line-height: 30px;
    border: solid 1px rgb(233, 237, 240);
    /* border-radius: 5px; */
    margin: 5px;
    font-family: serif;
    font-weight: bolder;
    color: black;
}
/* 悬浮效果 */
.single_item:hover{
    box-shadow: -10px 10px 10px #e6e3e3;
	transform:translate(0px,-2px);
}
.important{
    background-color: rgb(172, 207, 240);
}
.finish{
    background-color: greenyellow;
}
.urgent{
    background-color: orange;
}
.float-right{
    float:right;
    margin-right: 5px;
}
.float-left{
    float:left;
    margin-left: 5px;
}
</style>